package com.xiaoshuidi.cloud.module.report.constant;

public enum ContractCompanyTypeEnum {

    PERSONAL("personal","租客合同"),

    COMPANY("company","企业合同"),


    ;

    private String type;

    private String value;

    ContractCompanyTypeEnum(String type, String value) {
        this.type = type;
        this.value = value;
    }

    public String getType() {
        return type;
    }

    public String getValue() {
        return value;
    }

    public static String getValueByType(String type){
        for (ContractCompanyTypeEnum typeEnum : ContractCompanyTypeEnum.values()) {
            if(typeEnum.type.equals(type)){
                return typeEnum.value;
            }
        }
        //拿不到返回type
        return type;
    }


    public static String getTypeByValue(String value){
        for (ContractCompanyTypeEnum typeEnum : ContractCompanyTypeEnum.values()) {
            if(typeEnum.value.equals(value)){
                return typeEnum.type;
            }
        }
        //拿不到返回value
        return value;
    }
}
